package com.ht.dao;

import org.apache.ibatis.annotations.Select;

public interface IndexDao {
    //已审批数
    @Select("select count(*) from act_ru_task where ASSIGNEE_ = #{empId}")
    int countByTask(String empId);

    //未审批数
    @Select("select count(*) from act_ru_variable where TEXT_ = #{empId}")
    int noByVar(String empId);

    //已提交周报数
    @Select("select count(*) from weekly where empId =  #{empId}")
    int countByWeekly(String empId);

    //未提交周报数
    @Select("select 5-count(*) from weekly where empId = #{empId}")
    int noByWeekly(String empId);

    //已提交谈心交流数
    @Select("select 5-count(*) from chatrecord where teacher =  #{empId}")
    int countByChc(String empId);

    //未提交谈心交流数
    @Select("select count(*) from chatrecord where teacher = #{empId}")
    int noByChc(String empId);

    //已读通知公告
    @Select("select count(*) from noticereceiver nc, notice n where nc.receiver = #{receiver} and nc.isRead = 1 and n.noticeType = 1 and  nc.noticeId = n.noticeId")
    int countNoticeRece(String receiver);

    //未读通知公告
    @Select("select count(*) from noticereceiver nc, notice n where nc.receiver = #{receiver} and nc.isRead = 2 and n.noticeType = 1 and  nc.noticeId = n.noticeId")
    int notNoticeRece(String receiver);
}
